import { EnumStorageKey } from "@/types/common/storage";
import { getLocal, removeLocal, setLocal } from "../store/local";

/** 设置token */
export function setToken(token: string) {
    setLocal(EnumStorageKey.token, token)
}
/** 设置refresh-token */
export function setRereshToken(token: string) {
    setLocal(EnumStorageKey["refresh-token"], token);
}

/** 获取token */
export function getToken() {
    return getLocal<string>(EnumStorageKey.token) || '';
}
/** 获取refresh-token */
export function getRefreshToken() {
    return getLocal<string>(EnumStorageKey["refresh-token"]) || '';
}

/** 删除token */
export function removeToken() {
    removeLocal(EnumStorageKey.token);
}
/** 删除refresh-token */
export function removeRefreshToken() {
    removeLocal(EnumStorageKey["refresh-token"]);
}